#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
using namespace std;

class Solution1
{
public:
    void solve()
    {
        int n, x; cin >> n >> x;
        vector<int> nums(n);
        for (int i = 0; i < n; ++i) cin >> nums[i];

        int l = 0, r = 0, cur = 0, cnt = INT_MAX;
        for (int i = 0, j = 0; j < n; ++j)
        {
            cur += nums[j];
            if (cur >= x)
            {
                while (cur >= x)
                    cur -= nums[i++];
                if (j - i + 1 < cnt)
                {
                    l = i - 1; r = j;
                    cnt = j - i + 1;
                }
            }
        }
        cout << l << ' ' << r << endl;
    }
};

class Solution2 {
public:
    int n, m;
    string w;
    int dx[4] = { 1,-1,0,0 };
    int dy[4] = { 0,0,1,-1 };
    bool vis[101][101];

    bool dfs(vector<string>& board, int i, int j, int pos)
    {
        if (pos == w.size()-1) return true;

        vis[i][j] = true;
        for (int k = 0; k < 4; ++k)
        {
            int x = i + dx[k]; int y = j + dy[k];
            if (x >= 0 && y >= 0 && x < n && y < m && !vis[x][y] && board[x][y] == w[pos + 1])
            {
                if (dfs(board, x, y, pos + 1))
                    return true;
            }
        }
        vis[i][j] = false;

        return false;
    }

    bool exist(vector<string>& board, string word) {
        memset(vis, 0, sizeof vis);
        n = board.size(); m = board[0].size();
        w = word;
        for (int i = 0; i < n; ++i)
            for (int j = 0; j < m; ++j)
            {
                if (board[i][j] == word[0] && dfs(board, i, j, 0))
                    return true;
            }

        return false;
    }
};

int main()
{

    return 0;
}